from django.contrib import admin
from certificate_manager.models import Cert, Join, CertPic

class JoinInline(admin.TabularInline):
	model = Join
	extra = 1

class CertPicInline(admin.TabularInline):
	model = CertPic

@admin.register(Cert)
class CertAdmin(admin.ModelAdmin):
	fields = ['cate', 'name', 'level', 'score', 'achieved_date', 'all_accept']
	# list_filter = (Layer0Filter, DepartmentFilter)
	list_display = ('cate', 'achieved_date')
	
	inlines = [
                CertPicInline,
		JoinInline,
	]
